package cn.qingyun.gis.modules.init.system.service;

import cn.qingyun.gis.cache.constant.CacheConstant;
import cn.qingyun.gis.common.system.vo.ComboModel;
import cn.qingyun.gis.common.system.vo.DictModel;
import cn.qingyun.gis.modules.init.system.entity.dto.OnlineAuthDTO;
import cn.qingyun.gis.modules.init.system.entity.dto.message.*;
import cn.qingyun.gis.modules.init.system.vo.*;
import com.alibaba.fastjson.JSONObject;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;
import java.util.Set;

public interface ISysBaseService {
    @Cacheable(cacheNames = CacheConstant.SYS_USERS_CACHE, key = "#username")
    LoginUser getUserByName(String username);

    String translateDictFromTable(String table, String text, String code, String key);

    String translateDict(String code, String key);

    List<SysPermissionDataRuleModel> queryPermissionDataRule(String component, String requestPath, String username);

    SysUserCacheInfo getCacheUser(String username);

    LoginUser getUserById(String id);

    List<String> getRolesByUsername(String username);

    List<String> getDepartIdsByUsername(String username);

    List<String> getDepartNamesByUsername(String username);

    DictModel getParentDepartId(String departId);

    @Cacheable(value = CacheConstant.SYS_DICT_CACHE, key = "#code")
    List<DictModel> queryDictItemsByCode(String code);

    List<DictModel> queryTableDictItemsByCode(String table, String text, String code);

    List<DictModel> queryAllDepartBackDictModel();

    void sendSysAnnouncement(MessageDTO message);

    void sendBusAnnouncement(BusMessageDTO message);

    void sendTemplateAnnouncement(TemplateMessageDTO message);

    void sendBusTemplateAnnouncement(BusTemplateMessageDTO message);

    String parseTemplateByCode(TemplateDTO templateDTO);

    void updateSysAnnounReadFlag(String busType, String busId);

    List<DictModel> queryAllDict();

    List<SysCategoryModel> queryAllDSysCategory();

    List<DictModel> queryFilterTableDictInfo(String table, String text, String code, String filterSql);

    List<String> queryTableDictByKeys(String table, String text, String code, String[] keyArray);

    List<ComboModel> queryAllUserBackCombo();

    JSONObject queryAllUser(String userIds, Integer pageNo, int pageSize);

    List<ComboModel> queryAllRole(String[] roleIds);

    List<String> getRoleIdsByUsername(String username);

    String getDepartIdsByOrgCode(String orgCode);

    List<SysDepartModel> getAllSysDepart();

    DynamicDataSourceModel getDynamicDbSourceById(String dbSourceId);

    DynamicDataSourceModel getDynamicDbSourceByCode(String dbSourceCode);

    List<String> getDeptHeadByDepId(String deptId);

    void sendWebSocketMsg(String[] userIds, String cmd);

    List<LoginUser> queryAllUserByIds(String[] userIds);

    void meetingSignWebsocket(String userId);

    List<LoginUser> queryUserByNames(String[] userNames);

    SysDepartModel selectAllById(String id);

    List<String> queryDeptUsersByUserId(String userId);

    Set<String> getUserRoleSet(String username);

    Set<String> getUserPermissionSet(String username);

    boolean hasOnlineAuth(OnlineAuthDTO onlineAuthDTO);

    Set<String> queryUserRoles(String username);

    Set<String> queryUserAuths(String username);

    List<JSONObject> queryUsersByUsernames(String usernames);

    List<JSONObject> queryDepartsByOrgcodes(String orgCodes);
}
